package com.mine.dynamicproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class EatProxy<T> implements InvocationHandler {
    private T object ;

    public EatProxy(T t) {
        this.object = t;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("before invoke");
        Object invoke = method.invoke(object, args);
        System.out.println("after invoke");
        return invoke;
    }
}
